namespace Tuxedo
{
	public static class Program
	{
		public static void Main(string[] args)
		{
#if DEBUG
			UnitTests.UnitTest.RunAllTests();
#endif

			args = new string[] { "C:\\Things\\Tuxedo\\SpaceSquirrel\\SpaceSquirrel.sln" };
			args = new string[] { "csproj:C:\\Things\\Tuxedo\\SpaceSquirrel\\SpaceSquirrel\\SpaceSquirrel.csproj" };

			string firstArg = args[0];
			if (firstArg.StartsWith("csproj:"))
			{
				string csprojPath = firstArg.Substring("csproj:".Length);
				string contents = FileReader.ReadFile(csprojPath);
				if (contents != null)
				{
					CsProjData data = CsProjReader.Read(System.IO.Path.GetDirectoryName(csprojPath), contents);

					Compile.Compiler compiler = new Compile.Compiler(data);
					Compile.FPClass[] firstPassClasses = compiler.Compile();

					Link.Linker linker = new Link.Linker();
					Link.Class[] linkedClasses = linker.Link(firstPassClasses);
				}
			}
			else
			{
				System.Console.WriteLine("Bad argument");
				return;
			}
		}
	}
}
